package com.hwadee.teachingprocessmanagementsystem.entity;

import java.io.Serializable;

/**
 * (User)实体类
 *
 * @author makejava
 * @since 2024-07-11 14:20:03
 */
import com.hwadee.teachingprocessmanagementsystem.annotation.Role;
import lombok.Data;
@Data
public class User implements Serializable {
    private Integer id;
/**
     * 用户ID
     */
    private String uid;
/**
     * 用户密码
     */
    private String password;
/**
     * 用户权限等级
     */
    private Integer role;
/**
     * 关联的具体角色ID
     */
    private String referenceId;

    public static Role getRole(User user) {
        if (user.getRole() == 1) {
            return Role.USER;
        }
        if (user.getRole() == 2) {
            return Role.MANAGER;
        }
        if (user.getRole() == 3) {
            return Role.MANAGER;
        }
        return null;
    }
}

